/**
 * Copyright (c) 2020-2021 浦东大爷 All rights reserved.
 * 机会永远都是留给有准备的人
 */
package com.learning.moudle3;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author: gitwo
 * @date: 2020-11-23
 * @description:
 */
public class LocalTimeTest {
    public static void main(String[] args) throws ParseException {
        String str1 = "20201119 00:11:13.271";
        String str2 = "20201119 00:11:15.171";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
//        System.out.println(simpleDateFormat.toString());
//        Calendar cal = Calendar.getInstance();
//        System.out.println(simpleDateFormat.format(cal.getTime()));

        Date parse1 = simpleDateFormat.parse(str1);
        Date parse2 = simpleDateFormat.parse(str2);
        System.out.println(parse2.getTime() - parse1.getTime());
    }
}
